package script.grammar.symbol;

public enum NativeType implements Type {
	VOID("void", "void", 0),
	BOOLEAN("bool", "boolean", 1),
	INT("int", "int", 2),
	DOUBLE("float", "double", 3),
	OBJECT("object", "Object", 4);
	
	private final String name, alias;
	private final int index;
	private final TypeSymbol symbol;
	
	NativeType(String name, String alias, int index) {
		this.name = name;
		this.alias = alias;
		this.index = index;
		this.symbol = new TypeSymbol(getName(), this);
	}

	@Override
	public String getName() {
		return name;
	}
	
	@Override
	public String getAlias() {
		return alias;
	}

	@Override
	public int getIndex() {
		return index;
	}

	@Override
	public Symbol getTypeSymbol() {
		return symbol;
	}
}
